package com.itheima.leyou;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

import java.util.HashMap;
import java.util.Map;

@SpringBootApplication
@EnableEurekaClient
public class StockApplication {

	/**
	 * 初始化restTemplate的bean，用于调用其他服务程序接口
	 * @return
	 */
	@Bean
	@LoadBalanced
	public RestTemplate getRestTemplate(){
		return new RestTemplate();
	}

	public static void main(String[] args) {
		SpringApplication.run(StockApplication.class, args);

		Map<String, String> map = new HashMap<>();
		map.put("username", "林一");
		map.put("password", "123");
		map.put("phone", "18801031984");
		System.out.println(map);

	}

}
